{% extends 'layout.html' %}
{% block content %}
    <div>
        <div class="container">

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">批量增加部门</h3>
                </div>
                <div class="panel-body">
                    <!-- enctype="multipart/form-data" 上传文件内容 -->
                    <form action="/depart/excel/" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                        <div class="form-group">
                            <input type="file" name="exfile">
                        </div>
                        <input type="submit" class="btn btn-primary" value="提交">
                    </form>
                </div>
            </div>


            <a href="/depart/add/" class="btn btn-primary"> <span class="glyphicon glyphicon-plus"
                                                                  aria-hidden="true"></span> 增加部门</a>
            <div class="bs-example" data-example-id="simple-table">
                <table class="table table-bordered">
                    <caption><span class="glyphicon glyphicon-list" aria-hidden="true"></span> 部门列表</caption>
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>部门名称</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for item in departs %}
                        <tr>
                            <th scope="row">{{ item.id }}</th>
                            <td>{{ item.title }}</td>
                            <td>
                                <a class="btn btn-success" href="/depart/{{ item.id }}/update/">编辑</a>
                                <a class="btn btn-danger" href="/depart/del/?nid={{ item.id }}">删除</a>
                            </td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>

            <ul class="pagination" style="float: left">
                {{ page_str }}

            </ul>
        </div>
    </div>

{% endblock %}